<include file="Public:header" />
<!-- MAIN CONTENT start -->
<literal>
    <style>
        .table th, .table td {
            text-align: center;
            /*height:38px;*/
        }

    </style>
</literal>
<div class="span12">
    <div class="well">
        <span>根据名称过滤：</span>
        <empty name="sub_grade">
            <span class="label">全部</span>
        <else/>
            <a href="{:U('/Rank/index')}">
                <span class="label label-info">全部</span>
            </a>
        </empty>

        <foreach name="grade" key="k" item="v_g">
            <if condition=" $v_g eq $sub_grade ">
                    <span class="label">{$v_g}</span>
                <else/>
                <a href="{:U('/Rank/index',array('grade'=>$v_g))}">
                    <span class="label label-info"><strong>{$v_g}</strong></span>
                </a>
            </if>
        </foreach>
    </div>
    <div class="well blank-slate">
        <!--<h3>Problem List</h3>-->
        <form class="form-search form-margin" role="form">
            <div class="row">
                <div class="col-lg-6">
                    <div class="input-group">
                        <input type="text" class="form-control " name="keywords" value="{$keywords}" placeholder="输入关键字"/>
                        <span class="input-group-btn">
                            <button class="btn " type="submit">
                                <i class="icon-search"></i>Go!
                            </button>
                        </span>
                    </div>
                </div>
            </div>
        </form>
        <!--<form class="form-search marg_bot">-->
            <!--<span >关键字查询</span>-->
            <!--<input type="text" name="keywords" value="{$keywords}" placeholder="输入关键字"/>-->
            <!--<button type="submit" class="btn">查找</button>-->
        <!--</form>-->
        <table class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th>ID</th>
                <th>名称</th>
                <th>状态</th>
                <th>权限</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" key="k" item="v">
                <tr>
                    <td>
                        {$v.contest_id}
                    </td>
                    <td>
                        <a href="{:U('Contest/view/',array('id'=>$v['contest_id']))}">{$v.title}</a>
                    </td>
                    <if condition="$v.end_time lt $now ">
                        <td >
                            <i class="icon-remove-circle"> </i>
                            <span class="label label-warning">
                                Ended@{$v.end_time|date='Y-m-d H:i:s',###}
                            </span>

                        </td>
                        <elseif condition="$v.start_time gt $now"/>
                        <td >
                            <i class="icon-remove-circle"> </i>
                            <span class="label label-warning">
                                Start@{$v.start_time|date='Y-m-d H:i:s',###}
                            </span>
                            <p>赛时:{}</p>
                        </td>
                        <else/>
                        <td>
                            <i class="icon-ok-circle"></i>
                            <span class="label label-warning">
                               Running
                            </span>
                            <p>剩余:{}</p>
                        </td>
                    </if>
                    <if condition="$v.private eq 0">
                        <td>
                            <i class="icon-ok-circle"></i>
                            <span class="label label-success">Public</span>
                        </td>
                        <else/>
                        <td>
                            <i class="icon-remove-circle"></i>
                            <span class="label label-warning">Private</span>
                        </td>
                    </if>
                </tr>
            </foreach>
            <tr>
                <td colspan="6" align="center"> {$page}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<!-- MAIN CONTENT end-->
<include file="Public:footer" />